<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
[#include "../common/head.html"/]
[@head title="crawlerconfig.list.title"/]
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed page-quick-sidebar-over-content">
[#include "../common/top.html"/]
<!-- BEGIN CONTAINER -->
<div class="page-container">
	[#include "../common/left.html"/]
	[@menu menu="game" submenu="crawler-config"/]
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="ajax-modal" class="modal fade bs-modal bs-modal-large" tabindex="-1"></div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- Begin: life time stats -->
					<div class="portlet">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-list-ul"></i>[@spring.message code="crawlerconfig.list.caption"/]
							</div>
							<div class="actions">
								<a href="${ctx}/crawler-config/create" class="btn default yellow-stripe" data-toggle="modal" data-target="#ajax-modal">
									<i class="fa fa-plus"></i><span class="hidden-480">[@spring.message code="crawlerconfig.list.action.create"/]</span>
								</a>
							</div>
						</div>
						<div class="portlet-body">
							<div class="table-container">
								<div class="table-actions-wrapper"></div>
								<table class="table table-striped table-bordered table-hover" id="datatable_crawlerconfigs">
									<thead>
										<tr role="row" class="heading">
											<th style="text-align: center; width: 85px;">[@spring.message code="datatable.column.operation"/]</th>
											<th style="min-width: 160px;">[@spring.message code="crawlerconfig.list.datatable.column.gameName"/]</th>
											<th>[@spring.message code="crawlerconfig.list.datatable.column.url"/]</th>
											<th>[@spring.message code="crawlerconfig.list.datatable.column.delay"/]</th>
											<th>[@spring.message code="crawlerconfig.list.datatable.column.timeout"/]</th>
		                                    <th>[@spring.message code="datatable.column.available"/]</th>
		                                    <th>[@spring.message code="datatable.column.createdBy"/]</th>
		                                    <th>[@spring.message code="datatable.column.createdDate"/]</th>
		                                    <th>[@spring.message code="datatable.column.lastModifiedBy"/]</th>
		                                    <th>[@spring.message code="datatable.column.lastModifiedDate"/]</th>
										</tr>
										<tr role="row" class="filter">
		                                	<td>
												<div class="margin-bottom-5">
													<button class="btn btn-sm yellow filter-submit margin-bottom"><i class="fa fa-search"></i> [@spring.message code="datatable.filter.search"/]</button>
												</div>
												<button class="btn btn-sm red filter-cancel"><i class="fa fa-times"></i> [@spring.message code="datatable.filter.reset"/]</button>
											</td>
											<td>
												<select name="search_EQ_gameId" class="form-control form-filter input-sm">
													<option value="">[@spring.message code="datatable.filter.select"/]</option>
		                                            [#list gameList as item]
													<option value="${item.id}">${item.name}</option>
													[/#list]
												</select>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_LIKE_url">
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_delay">
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_timeout">
											</td>
											<td>
												<select name="search_EQ_available" class="form-control form-filter input-sm">
													<option value="">[@spring.message code="datatable.filter.select"/]</option>
													<option value="true">[@spring.message code="net.lanelife.casino.caipiao.entity.Available.TRUE"/]</option>
		                                            <option value="false">[@spring.message code="net.lanelife.casino.caipiao.entity.Available.FALSE"/]</option>
												</select>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_createdBy">
											</td>
											<td>
												<div class="input-group date date-picker margin-bottom-5" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_GTE_createdDate" placeholder="[@spring.message code="datatable.filter.from"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
												<div class="input-group date date-picker" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_LTE_createdDate" placeholder="[@spring.message code="datatable.filter.to"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_lastModifiedBy">
											</td>
		                                    <td>
												<div class="input-group date date-picker margin-bottom-5" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_GTE_lastModifiedDate" placeholder="[@spring.message code="datatable.filter.from"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
												<div class="input-group date date-picker" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_LTE_lastModifiedDate" placeholder="[@spring.message code="datatable.filter.to"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
											</td>
										</tr>
									</thead>
									<tbody>
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- End: life time stats -->
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

[#include "../common/foot.html"/]

[#assign path="${ctx}/crawler-config"/]

<script type="text/javascript">
jQuery(document).ready(function() {    
    grid.init({
        src: $("#datatable_crawlerconfigs"),
        fixedColumns: 1,
        onSuccess: function (data) { },
        onError: function (data) { },
        dataTable: {
            "pageLength": 20,
            "ajax": {"url": "${path}"},
            "columnDefs": [{'orderable': false, 'targets': [0]}],
            "columns": [
				{"data": "id", "render": function(data,type,full) {
					return '<div class="btn-group">'+
							'	<a href="#" class="btn blue-madison btn-xs btn-operation" data-toggle="dropdown">'+
							'		<i class="fa fa-cog"></i> ' + message['datatable.operation'] + 
							'	</a>'+
							'	<ul class="dropdown-menu pull-left">'+
							'		<li><a href="${path}/update/' + full.id + '" data-toggle="modal" data-target="#ajax-modal">' + message['operation.update'] + '</a></li>'+
							'		<li><a href="${path}/delete/' + full.id + '" data-toggle="delete">' + message['operation.delete'] + '</a></li>'+
							'		<li><a href="${path}/available:' + !full.available + '/' + full.id + '" data-toggle="request">' + (full.available ? message['operation.disable'] : message['operation.enable']) + '</a></li>'+
							'	</ul>'+
							'</div>';
				}},
				{"data": "gameName"},
				{"data": "url"},
				{"data": "delay"},
				{"data": "timeout"},
				{"data": "available", "render": function(data,type,full) {
					return data ? '<span class="label label-sm label-success">' + message['net.lanelife.casino.caipiao.entity.Available.TRUE'] + '</span>' : '<span class="label label-sm label-danger">' + message['net.lanelife.casino.caipiao.entity.Available.FALSE'] + '</span>';
				}},
				
				{"data": "createdBy"},
				{"data": "createdDate"},
				{"data": "lastModifiedBy"},
				{"data": "lastModifiedDate"}
			],
            "order": [
                [1, "desc"]
            ]
        }
    });
});
</script>

</body>
<!-- END BODY -->
</html>